<?php
/*------------------------------------------
* @AUTHOR: TANDAT @EMAIL:tidusvn05@gmail.com
* @PHONE: +84933731173
* -----------------------------------------*/
class ErrorController extends D_Controller
{
    private $_error;

    public function init()
    {
        $this->setLayout('error', 'userco');
    }

    public function errorAction()
    {
    	
    	$errors = $this->_getParam('error_handler');
    	
    	/*
        switch ($errors->type) {
            case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:
            case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:
                $this->getResponse()->setHttpResponseCode(404);
                $this->view->message = 'Page not found';
                break;
            default:
                $this->getResponse()->setHttpResponseCode(500);
                break;
        }
		*/
    	
        // Log exception, if logger available
      	$this->view->type = $errors->type;
      	
      	$sysControl = new Zend_Session_Namespace( 'sys_control' );
      	$sysControl->session_timeout = null;
    }

    private function _applicationError()
    {
       
    }

    private function _getLog()
    {
       	$writer = new Zend_Log_Writer_Stream("./application/log/errors.txt");
		$filter = new Zend_Log_Filter_Priority(Zend_Log::DEBUG);
		$writer->addFilter($filter);
		$logger = new Zend_Log($writer);
        return $logger;
    }
	
}
